<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="style/admin.css" />
<link rel="stylesheet" type="text/css" href="style/global.css" />
<link rel="stylesheet" type="text/css" href="style/tip.css" />
<title>咨询反馈</title>
</head>

<body>
<div id="wrap">
<div id="public_head"></div>
<div class="m_search">
<form action='' method='post'><input class="btn_add btn_search_add"
	name="" type="button" value=""
	onclick="location.href='/index.php?c=user&a=add'" /> 关键词<input
	class="qf_text" name="key" type="text" style="color: #999999"
	value="<?php echo !empty($vkey)?$vkey:'请输入用户名、姓名、工号...'?>" /> 用户组<select
	class="select" name="grade">
        			<?php 
        				if(is_array($groups) && count($groups)>0){
        					echo "<option value='0'>所有用户组</option>";
        					foreach ($groups as $k=>$v){
        			?>
        				<option value="<?php echo $k;?>"
		<?php if($k==$grade)echo 'selected';?>><?php echo $v;?></option>
        			<?php 
        					}
        				}else{
        					echo "<option value='0'>还没有添加用户组</option>";
        				}
        			?>
        		 </select> <input class="btn_search" name="sel_user"
	type="submit" value="" /></form>
</div>
<div class="m_content">
<table class="qi_table" width="0" border="0" cellpadding="0"
	cellspacing="1">
	<tr>
		<th>用户名</th>
		<th>姓名</th>
		<th>工号</th>
		<th>用户组</th>
		<th>状态</th>
		<th>操作</th>
	</tr>
             <?php 
             	if (is_array($alluser) && count($alluser)>0){
             		foreach ($alluser as $v){
             ?>
     <tr>
		<td><?php echo str_replace($vkey, '<font color=red><b>'.$vkey.'</b></font>&nbsp;', $v['USER_NAME'])?></td>
		<td><?php echo str_replace($vkey, '<font color=red><b>'.$vkey.'</b></font>&nbsp;', $v['TRUE_NAME'])?></td>
		<td><?php echo str_replace($vkey, '<font color=red><b>'.$vkey.'</b></font>&nbsp;', $v['DOC_NO'])?></td>
		<td><?php echo $groups[$v['ROLE_ID']]?></td>
		<td><?php echo $state[$v['STATE']]?></td>
		<td>
			<a href="/index.php?c=user&a=resetpwd&id=<?php echo $v['USER_ID']?>">重置密码</a> 
			<a href="/index.php?c=user&a=add&id=<?php echo $v['USER_ID']?>">修改</a>
			<a href="" class='deluser' pid='<?php echo $v['USER_ID']?>'>删除</a>
		</td>
	</tr>
              <?php
														}
													} else {
														?>
              <tr height="40">
		<td style="text-align: center; color: green;" colspan='10'>没有您搜索的结果</td>
	</tr>
              <?php }?>
    <tr><td colspan='10'>
					<?php 
						$url = '/index.php?c='.$_REQUEST['c'].'&a='.$_REQUEST['a'].'&p=_num_&grade='.$grade.'&key='.urlencode($vkey);
						echo JYTools::pager($url,$tolNum,$page,$pagesize);
					?>
	</td></tr>
</table>
</div>
</div>
</body>
</html>
<script src="/js/xheditor/jquery/jquery-1.4.4.min.js"
	type="text/javascript"></script>
<script src="/js/boot.js" type="text/javascript"></script>
<script src="/js/tip.js" type="text/javascript"></script>
<script src="/js/add_public_head.js" type="text/javascript"></script>
<script>
$('input.qf_text[name="key"]').focus(function(){
	if($(this).val()=='请输入用户名、姓名、工号...'){
		$(this).val('')
		$(this).css('color','#000')
	}
})
$('input.qf_text[name="key"]').blur(function(){
	if($(this).val()==''){
		$(this).val('请输入用户名、姓名、工号...')
		$(this).css('color','#999')
	}
})
$('input[type="submit"]').click(function(){
	if($('input.qf_text[name="key"]').val()=='请输入用户名、姓名、工号...'){
		$('input.qf_text[name="key"]').val('')
	}
})
$('.deluser').click(function(){
	if(T.confirm('确定删除吗？')){
		$.ajax({
			url:'/index.php?c=user&a=deluser&id='+$(this).attr('pid'),
			type:'get',
			dataType:'json',
			success:function(de){
				location.reload()
			}
		})
	}
	return false;
})
</script>